# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-vfs-libarchive
pkgver=19.0.1
_realname=Matrix
pkgrel=0
pkgdesc="Libarchive VFS add-on for Kodi"
options="!check" # no test suite
url="https://github.com/xbmc/vfs.libarchive"
arch="x86 x86_64 aarch64 armv7" # kodi is available only on those arches
license="GPL-2.0-only"
makedepends="cmake libarchive-dev lz4-dev kodi-dev"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/xbmc/vfs.libarchive/archive/$pkgver-$_realname.tar.gz"
builddir="$srcdir/vfs.libarchive-$pkgver-$_realname"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DUSE_LTO=1
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
564654afa74080e13e09100bcbab75315a5ca8dc0e7e2457c6ec9a12f227ace4fcd8164161a44b27508552347b829c87790108a2cf6db12ce5559565f18aa725  kodi-vfs-libarchive-19.0.1-Matrix.tar.gz
"
